<?php
// --------------------------------------------------------------------
/**
 * 自定义JSON输出，验证数据FengchaoClass
 *
 * 本类实现自定义msg输出，验证数据，判断提交数据
 * 是否符合要求等功能
 *
 *
 * @author		冯超
 * @copyright	Copyright (c) 2011 世讯网络
 * @link		http://www.hellophp.net
 * @since		Version 1.0
 * @filesource
 */
// --------------------------------------------------------------------
class FengchaoClass {

	private $msgPow;
	//是否返回自定义消息开关
	private $msgShow;
	//消息内容
	private $msgArr = array();
	//要验证是否为空的array
	private $checkArr = array();

	private $msgError = 1;
	// ----------------------------------------------------------------
	/**
	 * 自定义输出JSON  showhckmsg
	 *
	 * @access	public
	 * @param	$error  错误号 	string
	 * @param	$arr	自定义数组 	array
	 * @param	$Json		Msg内容		string
	 * @param	$Json		是否输出JSON		bool
	 * @return	json/array
	 */
	//------------------------------------------------------------------

	function showhckmsg($error = "", $arr = NULL, $m, $Json = false) {
		$error == "" ? $this -> msgError = 1 : $this -> msgError = $error;
		$this -> msgShow = $m;
		$this -> msgPow = $Json;
		if ($this -> msgPow) {
			$myArr = array();
			$myArr['Msg_error'] = $this -> msgError;
			$myArr['Msg'] = $this -> msgShow;
			$myArr['MsgTime'] = date("Y-m-d H:i:s");
			empty($arr) ? $this -> msgArr = $myArr : $this -> msgArr = ($myArr + $arr);

		}
		return json_encode($this -> msgArr);
		exit ;
	}

	/*
	 * 判断数据是否
	 */
	function sxCheckData($arr) {
		
	}

}
?>